import {
	request,
} from '@/api/request';
const apiList = [{
		name: 'getopenid',
		url: '/api/user/getopenid',
		method:'GET'
	},
	{
		name: 'wxLogin',
		url: '/api/user/wxLogin'
	},
	{
		name: 'userindex',
		url: '/api/user/index',
		method:'GET'
	},
	// /api/user/getWechatPhone
	{
		name: 'getWechatPhone',
		url: '/api/user/getWechatPhone',
		method:'GET'
	},
	// profile
	{
		name: 'profile',
		url: '/api/user/profile'
	},
]


module.exports = apiList.reduce((mode, params) => {
	mode[params.name] = (data, token) => request({
		url: params.url,
		method: params.method || 'POST',
		data,
		token,
		showlod: params.showlod
	})
	return mode
}, {})